<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="shortcut icon" href="../images/yc.png" type="image/x-icon">
<link rel="stylesheet" href="../css/layui.css"  media="all">
</head>
<body>
<br />
<div class="demoTable">
	<span class="navy_padding">订单编号</span>
    <div class="layui-inline">
      <input class="layui-input" type="text" name="ono"  autocomplete="off" style="width: 300px">
    </div>
   	<span class="navy_padding">会员名称</span>
    <div class="layui-input-inline">
       <input type="text" name="mname" autocomplete="off" class="layui-input">
	</div>
    <button type="button" class="layui-btn layui-btn-radius"> 查询  </button>
</div>

<table class="layui-hide" id="admin_data" lay-filter="test"></table>
<script type="text/html" id="barDemo">
	<a class="layui-btn layui-btn-xs" lay-event="detail">详细</a>
</script>
<script src="../js/layui.all.js" charset="utf-8"></script>
 
<script>
layui.use('table', function(){
	var table = layui.table, form = layui.form;
	table.render({
    	elem: '#admin_data',
		url:'../../order/findList',
		toolbar: '#toolbarDemo', // 开启头部工具栏，并为其绑定左侧模板
    	title: '管理员信息表',
    	limits: [2, 5, 10, 20, 30, 50, 100],
    	limit: 2,
    	cellMinWidth: 120,
    	id: "admin_data",
    	method: "POST",
	    cols: [[
	      {
			type: 'checkbox', fixed: 'center'},
	      	{field:'oid', title:'编号',fixed: 'center', unresize: true, sort: true, align: 'center'},
			{field:'aname', title:'用户名', align: 'center'},
			{field:'postal', title:'邮箱', align: 'center', templet: function(res){
	        	return '<em>'+ res.postal +'</em>'
	      	}},
			{field:'province', title:'省份', edit: 'text'},
			{field:'city', title:'城市', align: 'center'},
			{field:'totalprice', title:'总价', align: 'center', sort: true},
			{field:'area', title:'地区', align: 'center'},
			{field:'time', title:'下单时间', align: 'center'},
			{field:'ostatus', title:'状态', align: 'center', templet: function(res){
	        	return '<em>'+ ( res.ostatus == 1? '未支付':res.ostatus == 2? '未发货':res.ostatus == 3? '未评论':'已评论') +'</em>'
	      	}},
			{fixed: 'right', title:'操作', toolbar: '#barDemo', align: 'center'}
	    ]],
		page: { 
			layout: ['prev', 'page', 'next', 'count', 'skip', 'limit'], //自定义分页布局
	      //,curr: 5 // 设定初始在第 5 页
	      groups: 10, // 只显示 1 个连续页码
	      first: '首页', //不显示首页
	      last: '尾页' //不显示尾页
	      
	    }
	});

	
	//监听锁定操作
	form.on('checkbox(lockDemo)', function(obj){
		layer.tips(this.value + ' ' + this.name + '：'+ obj.elem.checked, obj.othis);
	});
  
	// 监听行工具事件
	table.on('tool', function(obj){
    	var data = obj.data;
    	if(obj.event === 'detail'){
    		layer.prompt({
        		formType: 3,
        		value: data.email
      		}, function(value, index){
				obj.update({
					email: value
        		});
        		layer.close(index);
      		});
    	}
	});
});
</script>
</body>
</html>